import React,{Component} from 'react';
import './fileInfo.scss';
import { getShopBaseInfo } from 'api/company.js';
export default class FileInfo extends Component{
	constructor (props) {
		super(props)
		this.state={
			shop_info: {}
		}
	}
	_getShopBaseInfo () { //店铺公司档案基本信息接口
		getShopBaseInfo({
			shop_id: this.props.shop_id
		}).then(res => {
			if(res.code === 1) {
				this.setState({
					shop_info:res.data
				})
			}
		})
	}
	componentDidMount () {
		this._getShopBaseInfo();
	}
	render () {
		return(
			<div className="fileInfo">
			{
				this.state.shop_info.shop_business === 0 ?
				<ul>
					<li>店铺名称：{this.state.shop_info.shop_name}</li>
					<li>店铺类别：个人店铺</li>
					<li>店铺等级：{this.state.shop_info.is_paid === 0 ? '普通' : '会员'}</li>
					<li>经营类目：{this.state.shop_info.business_sphere}</li>
					<li>开店时长：{this.state.shop_info.shop_duration}年</li>
					<li>联系人：{this.state.shop_info.contacts_name}</li>
					<li>联系电话：{this.state.shop_info.contacts_phone}</li>
				</ul>
				:
				<ul>
					<li>公司名称：{this.state.shop_info.shop_company_name}</li>
					<li>店铺名称：{this.state.shop_info.shop_name}</li>
					<li>店铺类别：企业店铺</li>
					<li>店铺等级：{this.state.shop_info.is_paid === 0 ? '普通' : '会员'}</li>
					<li>经营类目：{this.state.shop_info.business_sphere}</li>
					<li>开店时长：{this.state.shop_info.shop_duration}年</li>
					<li>联系人：{this.state.shop_info.contacts_name}</li>
					<li>联系电话：{this.state.shop_info.contacts_phone}</li>
				</ul>
			}
			</div>
		)
	}
}